#include<iostream>
//#include<algorithm>
#include<cmath>
#include<cstring>
using namespace std;
const int maxN = 100000 ;
int primes[maxN];

int main()
{
	int n;
	cin >> n;
	int i = 2, j = 2, k ;
	memset(primes, 1, sizeof(primes));
	primes[1] = 0;
	for (int index = 2; index  < sqrt(n + 10); index++) {
		if (primes[index]) {
			for (int index2 = index * index; index2 <= n; index2 += index) {
				primes[index2] = 0;
			}
		}
	}
	if (primes[n - 4]) {
		cout << i << " " << j << " " << n - 4 << endl;
		return 0;
	}
	for (k = n - 4 ; k >= 2; k --) {
		if (primes[k]) break;
	}

//	cout << k;
	j = n - i - k	;
//	int sum = i + j + k;
	while (primes[j] == 0) {// && n != i + j + k
		j--;

//		while (!primes[(j)]) { // 判断到下一个质数
//			j++;
//		}
//			j++;

//		j++;
		if ((n - k  - j) % 2 == 0) {// 奇偶判断
			i = 2;
		} else {
			i = 3;
		}
	}
	cout << i << " " << j << " " << k << endl;
//	cout << i;
	return 0;
}
// 1tle 1wa
// 2re
